﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyOCR_WPF.ViewModel
{
    public class OriginalForm : INotifyPropertyChanged //绑定对象
    {
        public static string original_content;//原文
        public static string translation_content;//译文

        public event PropertyChangedEventHandler PropertyChanged;

        private string res_content;
        public string translationContent
        {
            get { return translation_content; }
            set
            {
                translation_content = value;
                OnPropertyChanged("translationContent");
            }
        }

        public string originalContent
        {
            get { return original_content; }
            set
            {
                original_content = value;
                OnPropertyChanged("originalContent");
            }
        }

        public string Res_conetent { 
            get { 
                return translation_content == null ? originalContent : translationContent; 
            }
            set
            {
                res_content = translation_content == "" ? originalContent : translation_content;
                OnPropertyChanged("Res_conetent");
            }
        }

        protected void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
